package pojo;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

/**
 * 
 * @author zgy
 * 
 */
@Repository
public class ZcOrderItem implements RowMapper<ZcOrderItem>, Serializable {

	private Integer id;
	private Integer gid;
	private String gname;
	private Double gprice;
	private Integer gcount;
	private String orderNum;
	private Timestamp createTime;
	private Timestamp endTime;
	private Timestamp sendTime;
	private String status;
	private Integer userId;
	private String userMp;
	private String userName;
	private Integer userAreaId;
	private String userArea;
	private String userAddress;
	private Integer suserId;
	private String suserMp;
	private String suserName;
	//自定义字段
	private String gweek;
	private String gsellTime;
	private String payStatus;
	
	public ZcOrderItem() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	public ZcOrderItem(Integer id, Integer gid, String gname, Double gprice,
			Integer gcount, String orderNum, Timestamp createTime,
			Timestamp endTime, Timestamp sendTime, String status,
			Integer userId, String userMp, String userName, Integer userAreaId,
			String userArea, String userAddress, Integer suserId,
			String suserMp, String suserName) {
		super();
		this.id = id;
		this.gid = gid;
		this.gname = gname;
		this.gprice = gprice;
		this.gcount = gcount;
		this.orderNum = orderNum;
		this.createTime = createTime;
		this.endTime = endTime;
		this.sendTime = sendTime;
		this.status = status;
		this.userId = userId;
		this.userMp = userMp;
		this.userName = userName;
		this.userAreaId = userAreaId;
		this.userArea = userArea;
		this.userAddress = userAddress;
		this.suserId = suserId;
		this.suserMp = suserMp;
		this.suserName = suserName;
	}
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public Integer getGid() {
		return gid;
	}


	public void setGid(Integer gid) {
		this.gid = gid;
	}


	public String getGname() {
		return gname;
	}


	public void setGname(String gname) {
		this.gname = gname;
	}


	public Double getGprice() {
		return gprice;
	}


	public void setGprice(Double gprice) {
		this.gprice = gprice;
	}


	public Integer getGcount() {
		return gcount;
	}


	public void setGcount(Integer gcount) {
		this.gcount = gcount;
	}


	public String getOrderNum() {
		return orderNum;
	}


	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}


	public Timestamp getCreateTime() {
		return createTime;
	}


	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}


	public Timestamp getEndTime() {
		return endTime;
	}


	public void setEndTime(Timestamp endTime) {
		this.endTime = endTime;
	}


	public Timestamp getSendTime() {
		return sendTime;
	}


	public void setSendTime(Timestamp sendTime) {
		this.sendTime = sendTime;
	}


	public String getStatus() {
		return status;
	}


	public void setStatus(String status) {
		this.status = status;
	}


	public Integer getUserId() {
		return userId;
	}


	public void setUserId(Integer userId) {
		this.userId = userId;
	}


	public String getUserMp() {
		return userMp;
	}


	public void setUserMp(String userMp) {
		this.userMp = userMp;
	}


	public String getUserName() {
		return userName;
	}


	public void setUserName(String userName) {
		this.userName = userName;
	}


	public Integer getUserAreaId() {
		return userAreaId;
	}


	public void setUserAreaId(Integer userAreaId) {
		this.userAreaId = userAreaId;
	}


	public String getUserArea() {
		return userArea;
	}


	public void setUserArea(String userArea) {
		this.userArea = userArea;
	}


	public String getUserAddress() {
		return userAddress;
	}


	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}


	public Integer getSuserId() {
		return suserId;
	}


	public void setSuserId(Integer suserId) {
		this.suserId = suserId;
	}


	public String getSuserMp() {
		return suserMp;
	}


	public void setSuserMp(String suserMp) {
		this.suserMp = suserMp;
	}


	public String getSuserName() {
		return suserName;
	}


	public void setSuserName(String suserName) {
		this.suserName = suserName;
	}
	
	


	public String getGweek() {
		return gweek;
	}

	public void setGweek(String gweek) {
		this.gweek = gweek;
	}
	

	public String getGsellTime() {
		return gsellTime;
	}

	public void setGsellTime(String gsellTime) {
		this.gsellTime = gsellTime;
	}
	

	public String getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(String payStatus) {
		this.payStatus = payStatus;
	}

	@Override
	public ZcOrderItem mapRow(ResultSet rs, int rowNum) throws SQLException {
		ZcOrderItem e = new ZcOrderItem();
		e.setGname(rs.getString("gname"));
		e.setGprice(rs.getDouble("gprice"));
		e.setGcount(rs.getInt("gcount"));
		e.setSendTime(rs.getTimestamp("send_time"));
		return e;
	}	

	public String insertValuses(){
		String istr = "('"+gid+"','"+gname+"','"+gprice+"','"+gcount+"','"+orderNum+"','"+
				createTime+"','"+sendTime+"','"+userId+"','"+userMp+"','"+userName+"','"+
				userAreaId+"','"+userArea+"','"+userAddress+"'),";
		return istr;
	}	
}
